package com.xd.service.admin.XTGLY.impl;

import com.xd.Dto.ProductPageQueryDTO;
import com.xd.Mapper.ProductMapper;
import com.xd.Result.PageResult;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.xd.service.admin.XTGLY.UnitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UnitServiceImpl implements UnitService {
    @Autowired
    ProductMapper productMapper;
    @Override
    public PageResult getUnit(ProductPageQueryDTO productPageQueryDTO) {
        PageHelper.startPage(productPageQueryDTO.getPage(),productPageQueryDTO.getPageSize());
        Page page =productMapper.getProductUnit(productPageQueryDTO);
        return new PageResult(page.getTotal(),page.getResult());

    }
}
